clear
graph set window fontface "LM Roman 10"

import excel "CORP.xlsx", sheet("Sheet1") firstrow 
drop dif

gen dm = mofd(d)
format dm %tm
collapse AAA AA, by(dm)
tsset dm, monthly
gen dif=AA-AAA

gen dummy=5 // just to make the figure visually as intended, muting legends

twoway (line dummy dm, lcolor(white) lwidth(2pt) lpattern(solid)) ///
	   (line AAA   dm, lcolor(black) lwidth(2pt) lpattern(solid)) ///
	   (line AA    dm, lcolor(black) lwidth(2pt) lpattern(dash)) ///
	   (line dif   dm, lcolor(black) lwidth(2pt) lpattern(shortdash)), ///
	   yline(0,lcolor(black) lwidth(thin) lpattern(shortdash)) ///
	   graphregion(color(white)) plotregion(margin(zero)) plotregion(margin(l+4 r+4)) xlabel(,nogrid) ylabel(,nogrid) ///
	   title("U.S. AAA/AA Corporate Bond Yields", size(medium) color(black)) ///
	   ytitle("Percent", height(4.5)) ylabel(-1.00 " " 0.00 "0" 1.00 "1" 2.00 "2" 3.00 "3" 4.00 "4" 5.00 "5" 6.00 "6" 7.00 "7" 8.00 "8", tp(i) labgap(1.5) angle(0)) /// 
	   xtitle("") tlabel(2010m1 "2010" 2012m1 "2012" 2014m1 "2014" 2016m1 "2016" 2018m1 "2018", tp(i) labgap(1.2)) ///
	   legend(order(1 "") rows(1) region(lstyle(none))) 
*graph export "fig9a.eps", replace
